package com.jinly.ryder.database.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jinly.ryder.database.service.model.SqlTask;
import com.jinly.ryder.database.service.model.SqlTaskItem;
import com.jinly.ryder.flow.service.model.FlowApply;
import com.jinly.ryder.flow.service.model.FlowAudit;
import com.jinly.ryder.manage.service.model.DatabaseInstance;

import java.util.List;

public interface SqlTaskService {

    Page<SqlTask> sqlTaskPage(Page page, SqlTask query);

    void sqlTaskApply(FlowApply flowApply, FlowAudit flowAudit);

    SqlTask getSqlTaskByApplyId(Long applyId);

    void execSqlTask(SqlTask sqlTask, DatabaseInstance instance);

    SqlTask getSqlTask(Long taskId, boolean withItem);

    List<SqlTaskItem> queryItemList(Long taskId);

    /**
     * 解析sql
     */
    List<SqlTaskItem> parseSqlToItem(String sqlText);
}
